import time

from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop020"
attribute_name = '天天向上'


firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性')
#点击删除
firefox.find_element_by_xpath('//td[contains(.,"%s")]/following-sibling::td[4]/a[3]'%attribute_name).click()
firefox.switch_to.alert.accept()
time.sleep(5)

try:
    firefox.find_element_by_xpath('//td[contains(.,"%s")]'%attribute_name)
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过"%testCase)


firefox.quit()
